home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 December / Dec99.iso / Data / Main.dxr / 00027_Ms Piggy.ls < prev    next >
Encoding:
Text File  |  1999-10-05  |  2.4 KB  |  101 lines

  1. property done, result
  2.  
  3. on new me
  4.   return me
  5. end
  6.  
  7. on beginSprite me
  8.   done = 1
  9. end
  10.  
  11. on mouseUp me
  12.   mySubject = sprite(me.spriteNum).myURL
  13.   myOS = baVersion("mac")
  14.   myQT = baVersion("qt")
  15.   myPlatform = the platform
  16.   myMachine = the machineType
  17.   myFreebytes = the freeBytes
  18.   myBrowser = browserName()
  19.   myColorDepth = the colorDepth
  20.   myDesktopRect = the deskTopRectList
  21.   myDate = the short date
  22.   myDate = replaceChars(myDate, "/", "\")
  23.   myIssue = "December99"
  24.   myInfo = mySubject & "|" & myOS & "|" & myQT & "|" & myPlatform & "|" & myMachine & "|" & myFreebytes & "|" & myColorDepth & "|" & myDesktopRect & "|" & myBrowser
  25.   newCGI = "http://www.avantdigital.com/misspiggy/macworld/info.cgi?mySUBJECT=" & mySubject & "&myOS=" & myOS & "&myQT=" & myQT & "&myPLATFORM=" & myPlatform & "&myMACHINE=" & myMachine & "&myFREEBYTES=" & myFreebytes & "&myCOLORDEPTH=" & myColorDepth & "&myDESKTOPRECT=" & myDesktopRect & "&myBROWSER=" & myBrowser & "&myDATE=" & myDate & "&myISSUE=" & myIssue
  26.   newCGI = deleteSpaces(newCGI)
  27.   result = getNetText(newCGI)
  28.   done = 0
  29. end
  30.  
  31. on deleteSpaces s
  32.   more = 1
  33.   X = offset(" ", s)
  34.   repeat while X > 0
  35.     delete char X of s
  36.     X = offset(" ", s)
  37.   end repeat
  38.   return s
  39. end
  40.  
  41. on replaceSpaces s, c
  42.   more = 1
  43.   X = offset(" ", s)
  44.   repeat while X > 0
  45.     if not voidp(c) then
  46.       put c after char X of s
  47.     end if
  48.     delete char X of s
  49.     X = offset(" ", s)
  50.   end repeat
  51.   return s
  52. end
  53.  
  54. on exitFrame me
  55.   if done = 0 then
  56.     if netDone(result) then
  57.       case netError(result) of
  58.         "OK":
  59.           if the runMode = "author" then
  60.             alert("Yo dude")
  61.           end if
  62.           done = 1
  63.         "4159":
  64.           if the runMode = "author" then
  65.             alert("The URL is invalid.")
  66.           end if
  67.           done = 1
  68.         "4165":
  69.           if the runMode = "author" then
  70.             alert("The URL was not found.")
  71.           end if
  72.           done = 1
  73.       end case
  74.     end if
  75.   end if
  76. end
  77.  
  78. on replaceChars s, origChar, c
  79.   X = offset(origChar, s)
  80.   repeat while X > 0
  81.     if not voidp(c) then
  82.       put c after char X of s
  83.     end if
  84.     delete char X of s
  85.     X = offset(origChar, s)
  86.   end repeat
  87.   return s
  88. end
  89.  
  90. on replaceString s, origString, newString
  91.   X = offset(origString, s)
  92.   repeat while X > 0
  93.     if not voidp(newString) then
  94.       put newString after char X + length(origString) - 1 of s
  95.     end if
  96.     delete char X to X + length(origString) - 1 of s
  97.     X = offset(origString, s)
  98.   end repeat
  99.   return s
  100. end
  101.